package com.inspur.cloud.entity.dataspace.vo;

import com.inspur.cloud.entity.dataspace.UserEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@ApiModel(value = "租户/用户详情 返回给前端的信息")
public class UserDetailsBackParamToHuiZhi {
    @ApiModelProperty(value = "用戶名", example = "admin")
    private String userName;
    @ApiModelProperty(value = "用戶描述信息", example = "description")
    private String description;
    @ApiModelProperty(value = "用戶id", example = "description")
    private Integer userId;
    @ApiModelProperty(value = "登录失败次数", example = "0")
    private Integer failureTimes;
    @ApiModelProperty(value = "创建时间", example = "2019-10-16T02:21:20.649Z")
    private Date insDate;
    @ApiModelProperty(value = "更新时间", example = "2019-10-16T02:21:20.649Z")
    private Date updDate;
    @ApiModelProperty(value = "父id", example = "1")
    private Integer parentId;
    @ApiModelProperty(value = "角色", example = "10")
    private Integer userRole;
    @ApiModelProperty(value = "状态 O无效 1活跃", example = "10")
    private String status;

    public UserDetailsBackParamToHuiZhi(UserEntity userEntity) {
        this.userName = userEntity.getName();
        this.description = userEntity.getDescription();
        this.userId = userEntity.getId();
        this.failureTimes = userEntity.getFailureTimes();
        this.insDate = userEntity.getInsDate();
        this.updDate = userEntity.getUpdDate();
        this.parentId = userEntity.getParentId();
        this.userRole = userEntity.getRole();
        this.status = userEntity.getStatus();
    }
}
